Problem Solving in Computer Science : Week 10 Scribe on duty : Hossein Hojjat

نویسنده

  • Hossein Hojjat
چکیده

In this section we review the concept of transactional memories from [1]. A traditional way to make threads communicating and synchronizing with each other is by using locks and condition variables. These methods of synchronization are fundamentally flawed, since they do not compose well. Concurrent programs based on locking are also hard to follow and debug. In many cases, programming with locks sounds to be absurdly hard, e.g. for a scalable doubleended queue when the queue size is small. The problem in a sequential settings is easy to solve, but when the calls become concurrent it turns out to be an academic challenge to solve it. The transactional memory approach is an easy way to look at the synchronization problem. Similar to databases, we use transactions in order to access the memory. A set of instructions are wrapped with an atomic command to show that they obey the “all or nothing” semantics. So whenever an exception occurs in the middle of executing a transaction none of the instructions in the transaction can affect the state of the program. A direct consequence of using transactions is to avoid deadlocks, since nowhere during this approach something is locked. An effective way to make transactions is to use optimistic concurrency. Here, any access to the memory is logged into a transaction log. After the transaction finished, it is the duty of the system to commit all the reads and writes in the transaction log into the memory in one step. If the system could not commit the log, nothing would be changed in the memory. One has to merely re-run the transaction so that the changes take effect. So, instead of using condition variables to wake up threads, the transactions are run again and again until they successfully finish. The main problem with transactional memories is their run-time cost. In transactional memories most of the synchronizing burden is put on the system whereas the programming task becomes easier.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Solving random inverse heat conduction problems using PSO and genetic algorithms

The main purpose of this paper is to solve an inverse random differential equation problem using evolutionary algorithms. Particle Swarm Algorithm and Genetic Algorithm are two algorithms that are used in this paper. In this paper, we solve the inverse problem by solving the inverse random differential equation using Crank-Nicholson's method. Then, using the particle swarm optimization algorith...

متن کامل

Solving fuzzy stochastic multi-objective programming problems based on a fuzzy inequality

Probabilistic or stochastic programming is a framework for modeling optimization problems that involve uncertainty.In this paper, we focus on multi-objective linear programmingproblems in which the coefficients of constraints and the righthand side vector are fuzzy random variables. There are several methodsin the literature that convert this problem to a stochastic or<b...

متن کامل

The Relationship between Craig Interpolation and Recursion-Free Horn Clauses

Despite decades of research, there are still a number of concepts commonly found in software programs that are considered challenging for verification: among others, such concepts include concurrency, and the compositional analysis of programs with procedures. As a promising direction to overcome such difficulties, recently the use of Horn constraints as intermediate representation of software ...

متن کامل

An efficient one-layer recurrent neural network for solving a class of nonsmooth optimization problems

Constrained optimization problems have a wide range of applications in science, economics, and engineering. In this paper, a neural network model is proposed to solve a class of nonsmooth constrained optimization problems with a nonsmooth convex objective function subject to nonlinear inequality and affine equality constraints. It is a one-layer non-penalty recurrent neural network based on the...

متن کامل

Comparison of the effectiveness of cognitive computer games and parent-child interactive games on problem solving and positive and negative affect of ten-year-old children in Shiraz

In recent years, research on increasing cognitive and psychological status through play has received much attention. For this purpose, there are two categories of game including interactive home game and cognitive game that the first run in the home environment and the latter is implemented as computer software to increase cognitive abilities. The aim of this study was to compare the effectiven...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2008